/***************************************************************************
 * This document contains confidential and proprietary information
 * subject to non-disclosure agreements with AsiaInspection. This
 * information shall not be distributed or copied without written
 * permission from the AsiaInspection.
 ***************************************************************************/
package util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/***************************************************************************
 *<PRE>
 *  Project Name    : com.allen
 *
 *  Package Name    : util
 *
 *  File Name       : MwToken.java
 *
 *  Creation Date   : Jul 24, 2016
 *
 *  Author          : Allen Zhang
 *
 *  Purpose         : TODO
 *
 *
 *  History         : TODO
 *
 *</PRE>
 ***************************************************************************/

public class MwToken {


	public static void main(String args[]) throws NoSuchAlgorithmException {
		String login = "allen.zhang@asiainspection.com";
		StringBuilder token = new StringBuilder();
		token.setLength(0);

		MessageDigest md = MessageDigest.getInstance("MD5");
		md.update("135246".getBytes());
		byte[] digest = md.digest();
		StringBuffer sb = new StringBuffer();
		for (byte b : digest) {
			sb.append(String.format("%02x", b & 0xff));
		}

		System.out.println("md5:" + sb.toString());


		try {
			token.append(sb.toString()).append("1955555555555");
		} catch (Exception e) {

		}
		System.out.println(token.append("|").append(login).append("|false|false").toString());
	}
}
